import React from "react";
import { Navigate } from "react-router-dom";
import MainLayout from "@/layout";
import { useSelector } from "react-redux";
import { RootState } from "@/store";
type Props = {};

export default function RequireAuth({}: Props) {
  const { isLogin } = useSelector((state: RootState) => state.user);
  return <>{isLogin ? <MainLayout /> : <Navigate to="/login" />}</>;
}
